Imports System.Data.SqlClient

Public Class TelefonoXPersona
    Private IdTipoDoc As Integer
    Private NroDoc As String
    Private IdTipoTel As Integer
    Private NroTel As String
    Public Property TipoDocTel() As Integer
        Get
            Return IdTipoDoc
        End Get
        Set(ByVal value As Integer)
            IdTipoDoc = value
        End Set
    End Property
    Public Property NroDocTel() As String
        Get
            Return NroDoc
        End Get
        Set(ByVal value As String)
            NroDoc = value
        End Set
    End Property
    Public Property TipoTel() As Integer
        Get
            Return IdTipoTel
        End Get
        Set(ByVal value As Integer)
            IdTipoTel = value
        End Set
    End Property
    Public Property NroTelefono() As String
        Get
            Return NroTel
        End Get
        Set(ByVal value As String)
            NroTel = value
        End Set
    End Property

    Public Sub New()
        IdTipoDoc = 0
        NroDoc = ""
        IdTipoTel = 0
        NroTel = ""
    End Sub
    Public Function BuscarDatos(ByRef id As Integer, ByRef numdoc As String, ByRef con As ConexionBD) As DataSet

        Dim sql As String = ""
        Dim adapter As SqlDataAdapter = Nothing
        Dim datos As DataSet = New DataSet()
        sql = String.Format("SELECT * FROM TELEFONOXPERSONA WHERE idtipodoc={0} and nrodoc='{1}'", id, numdoc)
        adapter = New SqlDataAdapter(sql, con.ConexionBase)
        adapter.Fill(datos, "profesional")

        Return datos
    End Function
End Class
